import request from '@/utils/request'
/**
 *
 * 题目管理
 *
 **/

 //分页查询
 export const getQuestion = (params: any) =>
  request({
    'url': `/question/page`,
    'method': 'get',
    params
  })
 
 
    //新增题目
 export const addQuestion = (params: any) =>
  request({
    'url': '/question',
    'method': 'post',
    data:params
  })

  export const addTest = (params: any) =>
    request({
      'url': '/test',
      'method': 'post',
      data:params
    })

  
    //根据id查询题目
 export const findQuestionById = (id: number) =>
  request({
    'url': `/question/${id}`,
    'method': 'get',
  })

      //更新题目
 export const updateQuestion = (params: any) =>
  request({
    'url': '/question',
    'method': 'put',
    data:params
  })
  // 批量删除问题
  export const deleteBatchQuestions = (ids: number[]) =>
    request({
      'url': `/question`,
      'method': 'delete',
      params: { 
        ids: ids.join(',') // 将数组转换为逗号分隔的字符串
      }
    })